const Router = require('koa-router')
const { add, search, multiSearch,getGroupList,getUsers,getSceneAdd,getSceneSearch,getFaceverify } = require('../controller/baidu.controller')
const { getImageInfo } = require('../middleware/baidu.middleware')
const { getToken } = require('../face-api/baiduFace')

const router = new Router({ prefix: '/baidu' })
// 获取百度token
router.use(getToken)
// 组列表查询
router.post('/grouplist', getGroupList)
// 获取用户列表
router.post('/users',getUsers)
// 添加人脸到人脸库
router.post('/add', getImageInfo, add)
// 人脸搜索 1:N
router.post('/search', getImageInfo, search)
// 人脸搜索 M:N
router.post('/multisearch', getImageInfo, multiSearch)
// 场景化人脸注册
router.post('/scene/add', getImageInfo, getSceneAdd)
// 场景化人脸搜索
router.post('/scene/search',getImageInfo,getSceneSearch)
// 在线图片活体检测
router.post('/faceverify',getImageInfo,getFaceverify)

module.exports = router
